# 写入操作   增删改
# TODO 1.导入pymysql
import pymysql
# TODO 2.创建连接对象
conn = pymysql.connect(host='172.16.140.85', user='root', password='root',
                       database='advanced', charset='utf8')
cursor = conn.cursor()
sql = "DELETE FROM Press_sheet WHERE id = %d" % (1)
try:
    # 执行SQL语句
    cursor.execute(sql)
    # 提交修改
    cursor.commit()
except:
    # 发生错误时回滚
    cursor.rollback()

# 关闭连接

cursor.close()
conn.close()
